#ifndef _INDEX_TABLE_H_
#define _INDEX_TABLE_H_
#include <map>
#include <vector>
#include <string>
#include <memory>
#include "BplusTree.h"
#include "buffermanager.h"

class IndexTable{
private:
	std::vector<bool> empty_table;
	const static int index_name_mlen = 25;
	const static int attr_name_mlen = 25;
	const static int type_mlen = 5;
	const static int index_info_length = index_name_mlen + attr_name_mlen + type_mlen + sizeof(byte) + 2 * sizeof(int);
	std::shared_ptr<BufferManager> buffermanager;
	std::string table_name;
public:
	const static int empty_table_size = 1024;
	std::map<std::string, BplusTree *> tree_table;
	IndexTable(std::shared_ptr<BufferManager> buffermanager, const std::string &table_name);
	void createIndex(std::string index_name, std::string attr_name, std::string type, byte len);
	void dropIndex(std::string index_name);
	~IndexTable();
	Block first_block;
};

#endif